<template>
	<section>
		<!--工具条-->
		<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
			<el-form :inline="true" :model="filters">
				<el-form-item>
          <el-date-picker
              v-model="filters.startTime"
              type="date"
              placeholder="开始时间">
          </el-date-picker>
				</el-form-item>
        <el-form-item>
          <el-date-picker
              v-model="filters.endTime"
              type="date"
              placeholder="截止时间">
          </el-date-picker>
        </el-form-item>
				<el-form-item>
					<el-button type="primary" v-on:click="getUser">查询</el-button>
				</el-form-item>
			</el-form>
		</el-col>

		<!--列表-->
		<template>
			<el-table :data="users" highlight-current-row v-loading="loading" style="width: 100%;">
				<el-table-column type="index" width="60">
				</el-table-column>
				<el-table-column prop="birth" label="日期" min-width="120">
				</el-table-column>
				<el-table-column prop="addr" label="金额" width="200" align="center">
				</el-table-column>
			</el-table>
		</template>

	</section>
</template>
<script>
	import { getUserList } from '../../api/api';
	//import NProgress from 'nprogress'
	export default {
		data() {
			return {
				filters: {
          startTime: '',
          endTime:''
				},
				loading: false,
				users: [
				]
			}
		},
		methods: {
			//获取用户列表
			getUser: function () {
				let para = {
					startTime: this.filters.startTime,
          endTime: this.filters.endTime
				};
				this.loading = true;
				//NProgress.start();
				getUserList(para).then((res) => {
					this.users = res.data.users;
					this.loading = false;
					//NProgress.done();
				});
			}
		},
		mounted() {
			this.getUser();
		}
	};

</script>

<style scoped>

</style>